<template>
  <div class="container">
    <div class="search">
      <form action="/">
        <van-search
          v-model="value"
          placeholder="请输入搜索关键词"
          show-action
          @search="onSearch"
          @cancel="onCancel"
        />
      </form>
    </div>
    <div class="cont">
      <div class="menuList">
        <div
          v-for="(item,index) in list"
          :key="item.id"
          :class="{active:num==index}"
          class="nav"
          @click="getNum(index)"
        >{{ item }}</div>
      </div>

      <!-- <div class="tabCon">
        <div v-for="(itemCon,index) in 10" :key="index" class="tabList">
          <div class="listPic">
            <img src="@/assets/pic2.png" alt>
          </div>
          <div class="listName">庆阳红富士1.5kg</div>
          <div class="listPrise">
            ￥
            <span>39.9</span>
          </div>
        </div>
        <div v-for="(itemCon,index) in tabContents" :key="index" v-show="index == num">
              {{itemCon}}
        </div>
      </div> -->
      <itemClassfiy/>
    </div>
  </div>
</template>
<script>
import itemClassfiy from '@/components/item/item-classfiy'
export default {
  components: {
    itemClassfiy
  },
  data() {
    return {
      num: 0,
      list: ['庆阳苹果', '庆阳酥梨', '庆阳桃子'],
      tabContents: [
        // "123456",
        // "789456",
        // "465123"
      ]
    }
  },
  methods: {
    getNum(index) {
      this.num = index
    }
  }
}
</script>
<style lang="less">
.container {
  width: 100%;
  background: #f5f6f8;
  .search {
    width: 100%;
    margin: 0 auto;
    height: 50px;
    line-height: 50px;
    // border: 1px solid #000;
  }
  .cont {
    width: 100%;
    display: flex;
    margin-top: 8px;
    .menuList {
      width: 25%;
      height: 150vw;
      background: #fff;
      .nav {
        height: 50px;
        line-height: 50px;
        text-align: center;
        // border: 1px solid #000;
      }
    }
    .tabCon {
      height: auto;
      width: 75%;
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      margin: 0 7px;
      height: 150vw;
      overflow: scroll;

      .tabList {
        width: 48%;
        // border: 1px solid;
        margin: 5px 0;
        background: #fff;
        .listPic {
          width: 144px;
          height: 144px;
          //   border:1px solid #000;
          img {
            width: 100%;
          }
        }
        .listName {
          font-size: 14px;
          color: #000;
          font-weight: bold;
          padding: 5px;
          width: 95%;
        }
        .listPrise {
          color: #d63a54;
          font-size: 16px;
          span {
            font-size: 20px;
          }
        }
      }
    }
  }
}
</style>
